import {createStore,applyMiddleware,compose,combineReducers} from 'redux';

import thunk from 'redux-thunk';

// 引入拆分出去的reducer
import userReducer from './modules/user/reducer';
import bookReducer from './modules/book/reducer';
import searchReducer from './modules/search/reducer';
import detailsReducer from './modules/details/reducer';

const composeEn = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const store = createStore(
  combineReducers({
    user: userReducer,
    book: bookReducer,
    search: searchReducer,
    details: detailsReducer
  }),
  composeEn(applyMiddleware(thunk))
);

export default store;
